#include <iostream>
#include <cstring>
#include <queue>
#include <map>
#include <vector>
#include <string.h>
using namespace std;

int N, K;
string s;
struct dp
{
    string sum;
    dp()
    {
        sum = "0";
    }
} f[50][10]; //表示前i为数字有j个乘号

string max(const string &a, const string &b)
{
    if (a.length() == b.length())
        return a > b ? a : b;
    else
        return a.length() > b.length() ? a : b;
}

string mul(const string &a, const string &b)
{
    if (a == "0" || b == "0")
        return "0";
    int m = a.size(), n = b.size();

    vector<int> tmp(m + n);
    for (int i = 0; i < m; ++i)
    {
        for (int j = 0; j < n; ++j)
        {
            /*n1[i] * n2[j]的结果在tmp[i + j + 1]处 先不考虑进位 后续处理它*/
            tmp[i + j + 1] += (a[i] - '0') * (b[j] - '0');
        }
    }
    /*处理进位 从尾向前进整除10的值 每个数变为本来%10*/
    for (int i = m + n - 1; i >= 1; --i)
    {
        tmp[i - 1] += tmp[i] / 10;
        tmp[i] %= 10;
    }

    string ret;
    int i = (tmp[0] == 0 ? 1 : 0); //查看前导0
    while (i < m + n)
    {
        ret.push_back(tmp[i] + '0');
        ++i;
    }
    return ret;
}

string cnt(int i, int j)
{
    return s.substr(i, j - i + 1);
}

int main()
{
    cin >> N >> K;
    cin >> s;
    s.insert(0, "0");
    for (int i = 1; i <= N; i++)
    {
        f[i][0].sum = s.substr(1, i);
    }
    for (int i = 1; i <= N; i++)
    {
        for (int j = 1; j <= K; j++)
        {
            for (int k = 1; k <= i; k++)
            {
                if (j-1<=k-2)//确保可以插入
                {
                    string temp = mul(f[k - 1][j - 1].sum, cnt(k, i)); //前k-1位插入j-1乘号，第k位开始未插入
                    f[i][j].sum = max(f[i][j].sum, temp);
                }
            }
        }
    }
    cout << f[N][K].sum << endl;
    system("pause");
    return 0;
}